<#import "/macro.ftl" as m>
<@m.page_header title='后台' />
<div id="page-content-wrapper">

<div id="page-title">

    <h3>
        <#if fund>修改基金<#else>添加基金</#if>
    </h3>
 
</div>
<div class="pad10A">
<#if fund> 
<form id="demo-form1" action="/fundmanage/fundmanageupdate/${fund.id}" class="col-md-12" method="POST">
<#else>
<form id="demo-form1" action="/fundmanage/fundmanageadd" class="col-md-12" method="POST">
</#if>

	<#if fund>
	<input type="hidden" name="id" value="${fund.id}"/>
	</#if>
   <div class="form-row">
        <div class="form-label col-md-2">
            <label for="">
                基金名称:
                <span class="required">*</span>
            </label>
        </div>
        <div class="form-input col-md-6">
            <input type="text" id="fundName" name="fundName" data-trigger="change" data-required="true" class="parsley-validated" value="${fund.fundName}">
        </div>
    </div>
    
    <div class="form-row">
	    <div class="form-label col-md-2">
	        <label for="">
	            基金代码:
	            <span class="required">*</span>
	        </label>
	    </div>
	    <div class="form-input col-md-6">
            <input type="text" id="fundCode" name="fundCode" data-trigger="change" data-required="true" class="parsley-validated" value="${fund.fundCode}">
	    </div>
	</div>
	
	<div class="form-row">
	    <div class="form-label col-md-2">
	        <label for="">
	            活动:
	        </label>
	    </div>
	    <div class="form-input col-md-4">
	        <select id="activitySelect" name="activitys" multiple="" class="chosen-select">
	        <#list saleActivityList as activity>
	            <option value="${activity.id}" <#list fund.activitys?split(",") as aid><#if aid==activity.id>selected</#if></#list>>${activity.name}</option>
	        </#list>
	        </select>
	    </div>
	</div>

<!--	
	<div class="form-row">
	    <div class="form-label col-md-2">
	        <label for="">
	            七日年化收益率:
	            <span class="required">*</span>
	        </label>
	    </div>
	    <div class="form-input col-md-2">
	        <input type="text" id="annualizedReturn" name="annualizedReturn" data-type="number" data-trigger="change" data-required="true" class="parsley-validated" value="${fund.annualizedReturn}">
	    </div>
    	<div class="col-md-2">%</div>
	</div>
	
	<div class="form-row">
	    <div class="form-label col-md-2">
	        <label for="">
	            万份收益:
	            <span class="required">*</span>
	        </label>
	    </div>
	    <div class="form-input col-md-2">
	        <input type="text" id="accrual" name="accrual" data-type="number" data-trigger="change" data-required="true" class="parsley-validated" value="${fund.accrual}">
	    </div>
	</div>
	
	<div class="form-row">
	    <div class="form-label col-md-2">
	        <label for="">
	            同期活期收益:
	            <span class="required">*</span>
	        </label>
	    </div>
	    <div class="form-input col-md-2">
	        <input type="text" id="currentincome" name="currentincome" data-type="number" data-trigger="change" data-required="true" class="parsley-validated" value="${fund.currentincome}">
	    </div>
	</div>
	
	<div class="form-row">
	    <div class="form-label col-md-2">
	        <label for="">
	            起点金额:
	            <span class="required">*</span>
	        </label>
	    </div>
	    <div class="form-input col-md-2">
	        <input type="text" id="minAmount" name="minAmount" data-type="number" data-trigger="change" data-required="true" class="parsley-validated" value="${fund.minAmount}">
	    </div>
	</div>
	
	<div class="form-row">
	    <div class="form-label col-md-2">
	        <label for="">
	            基金规模:
	            <span class="required">*</span>
	        </label>
	    </div>
	    <div class="form-input col-md-2">
	        <input type="text" id="scale" name="scale" data-type="number" data-trigger="change" data-required="true" class="parsley-validated" value="${fund.scale}">
	    </div>
	    <div class="col-md-2">亿元</div>
	</div>
	
	<div class="form-row">
        <div class="form-label col-md-2">
            <label for="">
                基金类型:
                <span class="required">*</span>
            </label>
        </div>
        <div class="form-input col-md-6">
            <input type="text" id="type" name="type" data-trigger="change" data-required="true" class="parsley-validated" value="${fund.type}">
        </div>
    </div>
    
    <div class="form-row">
        <div class="form-label col-md-2">
            <label for="">
                销售公司:
                <span class="required">*</span>
            </label>
        </div>
        <div class="form-input col-md-6">
            <input type="text" id="saleCompany" name="saleCompany" data-trigger="change" data-required="true" class="parsley-validated" value="${fund.saleCompany}">
        </div>
    </div>
    
    <div class="form-row">
        <div class="form-label col-md-2">
            <label for="">
                基金公司:
                <span class="required">*</span>
            </label>
        </div>
        <div class="form-input col-md-6">
            <input type="text" id="fundManager" name="fundManager" data-trigger="change" data-required="true" class="parsley-validated" value="${fund.fundManager}">
        </div>
    </div>
    
    <div class="form-row">
        <div class="form-label col-md-2">
            <label for="">
                发布时间:
                <span class="required">*</span>
            </label>
        </div>
        <div class="form-input col-md-2">
           <input type="text" name="releaseTime" data-trigger="focus" data-required="true" class="parsley-validated"
	               value="${(fund.releaseTime?string("yyyy-MM-dd HH:mm:ss"))!}"
	               onClick="WdatePicker({isShowWeek:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})"
	               style="clear:both;overflow:hidden;display:block">
        </div>
    </div>
    
    <div class="form-row">
        <div class="form-label col-md-2">
            <label for="">
                申购状态:
                <span class="required">*</span>
            </label>
        </div>
        <div class="form-input col-md-2">
            <select name="salestate">
        		<option value="1" <#if fund.salestate>selected</#if>>在售</option>
        		<option value="0" <#if fund.salestate>selected</#if>>未售</option>
        	</select>
        </div>
    </div>
-->    
    <div class="divider"></div>
    <div class="form-row">
        <input type="hidden" name="superhidden" id="superhidden">
       <div class="form-input col-md-10 col-md-offset-2">
                    <a href="javascript:;" class="btn medium primary-bg radius-all-4 col-md-2" id="demo-form-2-valid">
                        
                                                                         提交
                        
                 </a>
        </div>
    </div>   

</form>
</div>
</div>

<script type="text/javascript">

$(function(){
	$("#demo-form-2-valid").click(function(){
		$('#demo-form1').parsley('validate');
	    $('#demo-form1').trigger('submit');
	});
});

</script>